import request from "@/utils/request.js"

// 获取回款分页列表
export function getPaymentListApi(data){
	return request({
		url: '/crm/receivable/page',
		method: 'GET',
		params: data
	})
}
// 新建回款
export function createPaymentApi(data){
	return request({
		url: '/crm/receivable/create',
		method: 'POST',
		data: data
	})
}
//获取回款详情
export function getPaymentDetailApi(id){
	return request({
		url: `/crm/receivable/get?id=${id}`,
		method: 'GET'
	})
}
// 更新回款
export function updatePaymentApi(data){
	return request({
		url: '/crm/receivable/update',
		method: 'PUT',
		data: data
	})
}

// 删除回款
export function deletePaymentApi(id){
	return request({
		url: `/crm/receivable/delete?id=${id}`,
		method: 'DELETE'
	})
}
// 作废回款
export function cancelPaymentApi(data){
	return request({
		url: '/crm/receivable/invalidate',
		method: 'PUT',
		data: data
	})
}